home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Internet Tools 1995 April / Internet Tools.iso / security / tiger-2.2.3.check_devs.fix < prev    next >
Encoding:
Text File  |  1994-03-22  |  1.9 KB  |  80 lines

  1. This is a replacemnet ./scripts/sub/checkdevs for 'tiger-2.2.3'
  2. that fixes a typo.  To install, cut at the dotted line and
  3.  
  4. cp ./check_devs TIGERTOPLEVEL/scripts/sub/check_devs
  5. chmod 755 TIGERTOPLEVEL/scripts/sub/check_devs
  6.  
  7. Where TIGERTOPLEVEL is the top level of the tiger hierarchy.
  8.  
  9. ---SNIP HERE-----------------------------------------------------------------
  10. #!/bin/sh
  11. #
  12. #     tiger - A UN*X security checking system
  13. #     Copyright (C) 1993 Douglas Lee Schales, David K. Hess, David R. Safford
  14. #
  15. #     Please see the file `COPYING' for the complete copyright notice.
  16. #
  17. # sub/check_devs - 06/14/93
  18. #
  19. #-----------------------------------------------------------------------------
  20. # This script is not runnable directly.
  21.  
  22. file="$1"
  23.  
  24. [ "$CONFIGURED_ALREADY" != "YES" ] && {
  25.   echo "--ERROR-- [init008e] This script can not be run directly."
  26.   exit 1
  27. }
  28.  
  29. . $BASEDIR/initdefs
  30.  
  31. #
  32. # If run in test mode (-t) this will verify that all required
  33. # elements are set.
  34. #
  35. [ "$Tiger_TESTMODE" = 'Y' ] && {
  36.   haveallcmds GETCLIENTDIRS AWK GREP LS RM || exit 1
  37.   haveallfiles WORKDIR || exit 1
  38.   
  39.   echo "--CONFIG-- [init003c] $0: Configuration ok..."
  40.   exit 0
  41. }
  42.  
  43. #------------------------------------------------------------------------
  44. echo
  45. echo "# Looking for unusual device files..."
  46.  
  47. haveallcmds AWK GREP LS || exit 1
  48. haveallvars WORKDIR || exit 1
  49.  
  50. dldevdirs=
  51.  
  52. [ -n "$HOSTNAMESLIST" ] && haveallcmds GETCLIENTDIRS && {
  53.   dldevdirs="`$GETCLIENTDIRS | $AWK '{printf(\"%s/dev %s/devices \", $2, $2);}'`"
  54. }
  55.  
  56. [ ! -n "$DEVDIRSYS" ] && DEVDIRSYS="/dev/"
  57.  
  58. set $DEVDIRSYS $FS_DEVDIRS $dldevdirs
  59. greps="$GREP -v '^'$1 $file"
  60. shift
  61. for dir
  62. do
  63.   greps="$greps | $GREP -v '^'$dir"
  64. done
  65.  
  66. eval $greps > $WORKDIR/dev.list.$$
  67.  
  68. [ -s $WORKDIR/dev.list.$$ ] && {
  69.   message WARN fsys006a "" "Unexpected device files found:"
  70.   $SORT $WORKDIR/dev.list.$$ |
  71.   while read file
  72.   do
  73.     $LS $LSGROUP -ld "$file"
  74.   done
  75.   echo
  76. }
  77.  
  78. delete $WORKDIR/dev.list.$$
  79.